#{extends 'frame.html' /} #{set title:'流量记录管理' /} #{set 'moreStyles'}
<link rel="stylesheet" media="screen"
	href="@{'/public/stylesheets/admin/trafficRecord.css'}" />
<link rel="stylesheet" media="screen"
	href="@{'/public/stylesheets/jquery.pagination.css'}" />
<link rel="stylesheet" media="screen" href="@{'/public/stylesheets/datePicker.css'}" />
#{/set}

<div class="contentCard">
	<div class="contentTitle">流量记录列表</div>
	<div id="taskFilterPanel">
		<div class="clearfix mb10">
			<span class="floatLeft mr10">任务ID</span> <input type="text"
				id="taskId" class="inputText floatLeft mr10" /> <span
				class="floatLeft mr10">用户昵称</span> <input type="text" id="userNick"
				class="inputText floatLeft mr10" /> <span class="floatLeft mr10">关键词</span>
			<input type="text" id="kwd" class="inputText floatLeft mr10" /> <span
				class="floatLeft mr10">状态:</span> <select
				class="floatLeft mr10" id="status">
				<option value="" selected="selected">全部</option>
				#{list items:status, as:'s'}
				<option value="${s}">${s.name}</option>
				#{/list}
			</select> 
			<span class="floatLeft mr10">开始时间</span>
					<span class="floatLeft mr10 cal-date-input">
						<input class="inputDate start-date" id="modifyTimeStart" readonly="readonly" value=""  />
					</span>
					<span class="floatLeft mr10 med-cal-split">-</span>
					<span class="floatLeft mr10 cal-date-input">
						<input class="inputDate end-date" id="modifyTimeEnd" readonly="readonly" value="" />
					</span>
			<a class="stdColorButton floatLeft addTrafficBtn"
				href="javascript:;" id="queryBtn">查询</a>
		</div>
		<div class="clearfix">
			<a class="stdColorButton floatLeft addTrafficBtn" href="javascript:;"
				id="addTrafficBtn">添加流量</a>
		</div>
	</div>
	<div class="mt10">
		<table class="normTable">
			<thead>
				<tr>
					<td>任务ID</td>
					<td>宝贝ID</td>
					<td>用户昵称</td>
					<td>关键词</td>
					<td>关键词ID</td>
					<td>计划点击</td>
					<td>完成点击</td>
					<td>每日开始时间</td>
					<td>每日结束时间</td>
					<td>开始日期</td>
					<td>截止日期</td>
					<td>状态</td>
					<td>操作</td>
				</tr>
			</thead>
			<tbody id="trafficContainer"></tbody>
		</table>
		<div id="noMsg">
			<div class="warnBox">
				<span class="iconfont">&#xf00b6;</span> 没有记录!
			</div>
		</div>
		<div class="pagin-btm clearFix" style="display: none;">
			<div class="pagination"></div>
		</div>
		<div class="popWrapper" style="display: none;" id="tr_loading_mask">
			<div class="maskLayer"></div>
			<img class="tr_juhua" src="@{'/public/images/pre_loading.gif'}" />
		</div>
	</div>
</div>

<div class="popWrapper" id="addTraffic">
	<div class="maskLayer"></div>
	<div class="modalWnd">
		<a href="javascript:;" class="wnd_Close_Icon" title="关闭窗口"></a>
		<h3 class="topTile">添加流量</h3>
		<div class="modalWndInner">
			<form id="addTrafficForm" action="/admin/traffic/addTraffic" method="post">
			<input type="hidden" name="vo.id" id="id" value=""/>
			#{authenticityToken /}
				<div class="panelLine">
					<span class="floatLeft mr10">API类别：</span> <select
						class="bold required selectType" id="type" name="vo.type">
						<option selected="selected" value="TAOBAOPC">淘宝PC</option>
						<option value="TAOBAOMOBILE">淘宝移动端</option>
						<option value="JDPC">京东 PC</option>
						<option value="TBAD">淘宝直通车</option>
					</select>
				</div>
				<div class="panelLine" id="shopTypeDiv">
					<span class="floatLeft mr10">店铺类型：</span> <select
						class="bold required selectType" name="vo.shopType" id="shopType">
						<option selected="selected" value="">请选择店铺类型</option>
						<option value="b">b:天猫</option>
						<option value="c">c:淘宝</option>
					</select>
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">任务ID：</span> <input type="text"
						class="bold  inputText" value="0" id="addTaskId" name="vo.taskId">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">用户ID：</span> <input type="text"
						class="bold  inputText" id="userId" value="0" name="vo.userId" readonly="readonly">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">关键词：</span> <input type="text"
						class="bold required inputText" name="vo.kwd" id="kwd">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">宝贝ID：</span> <input type="text"
						class="bold required inputText" id="nid" name="vo.nid">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">日点击数：</span> <input type="text"
						class="bold required inputText" id="times" name="vo.times">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10" style="font-size: 10px;">(3路径占比之和为100)</span>
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">淘宝搜索路径占比：</span> <input type="text"
						class="bold required inputText" id="path1" value="100" name="vo.path1">
				</div>
				<div class="panelLine" id="searchPath">
					<span class="floatLeft mr10">淘宝搜天猫路径占比:</span> <input type="text"
						class="bold required inputText" id="path2" value="0" name="vo.path2">
				</div>

				<div class="panelLine" id="searchPath">
					<span class="floatLeft mr10">天猫搜索路径占比：</span> <input type="text"
						class="bold required inputText" id="path3" value="0" name="vo.path3">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">宝贝页停留时间(秒)：</span> <input value="100" type="text"
						class="bold required inputText" id="sleep_time" name="vo.sleepTime">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">每日开始时间(如8点)：</span> <input type="text"
						class="bold required inputText" value="8" id="click_start"
						name="vo.clickStart">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">每日结束时间(如23点)：</span> <input
						type="text" class="bold required inputText" value="23" id="click_end"
						name="vo.clickEnd">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">开始日期(如2014-09-23)：</span> <input
						type="text" class="bold required inputText" id="begin_time"
						name="vo.beginTime">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">截止日期(如2014-09-23)：</span> <input
						type="text" class="bold required inputText" id="end_time"
						name="vo.endTime">
				</div>
				<div class="wndBotButtonSection">
					<a id="btnSave" href="javascript:;" class="botButton">保存</a>
				</div>
			</form>
		</div>
	</div>
</div>

<div class="popWrapper" id="editTraffic">
	<div class="maskLayer"></div>
	<div class="modalWnd">
		<a href="javascript:;" class="wnd_Close_Icon" title="关闭窗口"></a>
		<h3 class="topTile">修改流量任务</h3>
		<div class="modalWndInner">
			<form id="editTrafficForm" action="/admin/traffic/addTraffic" method="post">
			<input type="hidden" name="vo.id" id="editId" value=""/>
			#{authenticityToken /}
				<div class="panelLine">
					<span class="floatLeft mr10">日点击数：</span> <input type="text"
						class="bold required inputText" id="editTimes" name="editTimes">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10" style="font-size: 10px;">(3路径占比之和为100)</span>
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">淘宝搜索路径占比：</span> <input type="text"
						class="bold required inputText" id="editPath1" name="editPath1">
				</div>
				<div class="panelLine editSearchPath">
					<span class="floatLeft mr10">淘宝搜天猫路径占比:</span> <input type="text"
						class="bold required inputText" id="editPath2" name="editPath2">
				</div>

				<div class="panelLine editSearchPath">
					<span class="floatLeft mr10">天猫搜索路径占比：</span> <input type="text"
						class="bold required inputText" id="editPath3" name="editPath3">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">宝贝页停留时间(秒)：</span> <input type="text"
						class="bold required inputText" id="editSleepTime" name="editSleepTime">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">每日开始时间(如8点)：</span> <input type="text"
						class="bold required inputText" id="editClickStart"
						name="editClickStart">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">每日结束时间(如24点)：</span> <input
						type="text" class="bold required inputText" id="editClickEnd"
						name="editClickEnd">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">开始日期(如2014-09-23)：</span> <input
						type="text" class="bold required inputText" id="editBeginTime"
						name="editBeginTime">
				</div>
				<div class="panelLine">
					<span class="floatLeft mr10">截止日期(如2014-09-23)：</span> <input
						type="text" class="bold required inputText" id="editEndTime"
						name="editEndTime">
				</div>
				<div class="wndBotButtonSection">
					<a id="editBtnSave" href="javascript:;" class="botButton">保存</a>
				</div>
			</form>
		</div>
	</div>
</div>

<textarea class="muban" id="trafficTemp">
	{{#results}}
				<tr data-id="{{id}}">
					<td>{{taskId}}</td>
					<td>{{nid}}</td>
					<td>{{userNick}}</td>
					<td>{{kwd}}</td>
					<td>{{kid}}</td>
					<td>{{times}}</td>
					<td>{{returnTimes}}</td>
					<td>{{clickStart}}</td>
					<td>{{clickEnd}}</td>
					<td>{{beginTime}}</td>
					<td>{{endTime}}</td>
					<td>{{statusStr}}</td>
					<td><a class="stdColorButton floatLeft editBtn"
				href="javascript:;" id="editBtn">修改</a></td>
				</tr>
	{{/results}}
</textarea>
#{set 'moreScripts'}
<script src="@{'/public/javascripts/date.js'}" type="text/javascript"></script>
<script src="@{'/public/javascripts/jquery.datePicker.js'}" type="text/javascript"></script>
<script src="@{'/public/javascripts/jquery.pagination.js'}"
	type="text/javascript"></script>
<script src="@{'/public/javascripts/mustache.min.js'}"
	type="text/javascript"></script>
<script src="@{'/public/javascripts/admin/trafficRecord.js'}"
	type="text/javascript"></script>
<script type="text/javascript">
	App.module = 'traffic';
</script>
#{/set}
